<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    .box {
      margin: 100px auto;
    }

    table {
      margin: 100px auto;
    }

    .box li {
      list-style: none;
    }

    .box table tr th {

      background-color: #f0ebeb;
    }

    .box table tr td {

      background-color: #ffffff;
    }

    table,
    td,
    th {
      border-collapse: collapse;
      border: 1px solid #000;
    }

    td,
    th {
      width: 100px;
      height: 20px;
      text-align: center;
      padding: 10px 30px 30px 10px;
    }
  </style>
</head>

<body>
  <script>
    let str = ''
    let data = [
      { subject: '语文', score: 46 },
      { subject: '数学', score: 80 },
      { subject: '英语', score: 100 },
    ]
    for (let i = 0; i < data.length; i++) {
      str += `
        <tr>
          <td>${i + 1}</td>
          <td>${data[i].subject}</td>
          <td>${data[i].score}</td>
          <td><a href="#">删除</a></td>
        </tr>
        `
    }
    document.write(`
    <div class="box">
      <table>
       <thead>
        <tr>
          <th>序号</th>
          <th>科目</th>
          <th>分数</th>
          <th>操作</th>
        </tr>
       </thead>
       <tbody>
         ${str}
       </tbody>
      </table>
    <div>
      `)
  </script>
</body>

</html>